const formatXToC = (x) => {
  x = x.toUpperCase()
  const upperLetter = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
  const dictionary = [...upperLetter, ...upperLetter.map(item1 => upperLetter.map(item2 => item1 + item2)).flat()]
  return dictionary.indexOf(x)
}

const formatYToR = (y) => {
  y = parseInt(y)
  return y - 1
}

export {
  formatXToC,
  formatYToR
}
